<header id="header" class=" typeheader-1" style="z-index: 10">
    <!-- Header Top -->
    <div class="header-top hidden-compact">
        <div class="container">
            <div class="row">
                <div class="header-top-left col-lg-7 col-md-8 col-sm-6 col-xs-4">
                    <div class="hidden-md hidden-sm hidden-xs welcome-msg">  <span>花径不曾缘客扫，蓬门今始为君开</span> </div>
                    <ul class="top-link list-inline hidden-lg ">
                        <li class="account" id="my_account">
                            <a href="#" title="My Account " class="btn-xs dropdown-toggle" data-toggle="dropdown"> <span class="hidden-xs">账号 </span>  <span class="fa fa-caret-down"></span>
                            </a>
                            <ul class="dropdown-menu ">
                                <li><a href="{{route('home.login.resign')}}"><i class="fa fa-user"></i> 注册</a></li>
                                <li><a href="{{route('home.login.loginFrom')}}"><i class="fa fa-pencil-square-o"></i>登陆</a></li>
                            </ul>
                        </li>
                    </ul>
                </div>
                <div class="header-top-right collapsed-block col-lg-5 col-md-4 col-sm-6 col-xs-8">
                    <ul class="top-link list-inline lang-curr">
                    </ul>
                </div>
            </div>
        </div>
    </div>
    <!-- //Header Top -->

    <!-- Header center -->
    <div class="header-middle">
        <div class="container">
            <div class="row">
                <!-- Logo -->
                <div class="navbar-logo col-lg-2 col-md-3 col-sm-4 col-xs-12">
                    <div class="logo"><a href="/"></a></div>
                </div>
                <!-- //end Logo -->
                <!-- Search -->
                <div class="col-lg-7 col-md-6 col-sm-5">
                    <div class="search-header-w">
                        <div class="icon-search hidden-lg hidden-md hidden-sm"><i class="fa fa-search"></i></div>

                        <div id="sosearchpro" class="sosearchpro-wrapper so-search ">
                            <form method="GET" action="index.html">
                                <div id="search0" class="search input-group form-group">
                                    <div class="select_category filter_type  icon-select hidden-sm hidden-xs">
                                        <select class="no-border" name="category_id">
                                            <option value="0">主题市场</option>
                                            @foreach($classifys as $classify)
                                            <option value="{{$classify->id}}">{{$classify->name}}</option>
                                           @endforeach
                                        </select>
                                    </div>

                                    <input class="autosearch-input form-control" type="text" value="" size="50" autocomplete="off" placeholder="输入关键词..." name="search">

                                    <button type="submit" class="button-search btn btn-primary" name="submit_search"><i class="fa fa-search"></i></button>

                                </div>
                                <input type="hidden" name="route" value="product/search" />
                            </form>
                        </div>
                    </div>
                </div>
                <!-- //end Search -->
                <div class="middle-right col-lg-3 col-md-3 col-sm-3">
                    <!--cart-->
                    <div class="shopping_cart">
                        <div id="cart" class="btn-shopping-cart">

                            <a data-loading-text="Loading... " class="btn-group top_cart dropdown-toggle" data-toggle="dropdown" aria-expanded="true">
                                <div class="shopcart">
                                        <span class="icon-c">
                                <i class="fa fa-shopping-bag"></i>
                              </span>
                                    <div class="shopcart-inner">
                                        <p class="text-shopping-cart">

                                           购物车
                                        </p>
                                    </div>
                                </div>
                            </a>

                            <ul class="dropdown-menu pull-right shoppingcart-box" role="menu">
                             @auth

                                        <li>
                                            <table class="table table-striped">
                                                <tbody>
                                               @auth
                                                   @foreach($carts as $cart)
                                                       <tr  >
                                                           <td class="text-center" style="width:70px">
                                                               <a href="product.html">
                                                                   <img src="{{$cart->getGood($cart->goods_id)['pictures'][0]}}" style="width:70px" alt="Yutculpa ullamcon" title="Yutculpa ullamco" class="preview">
                                                               </a>
                                                           </td>
                                                           <td  class="text-left"> <a   class="cart_product_name" href="{{route('showGoods',$cart->getGood($cart->goods_id))}}">{{$cart->getGood($cart->goods_id)['name']}}</a>
                                                           </td>
                                                           <td class="text-center">x{{$cart->getGood($cart->goods_id)['number']}}</td>
                                                           <td  class="text-center ">¥<span class="price">{{$cart->getGood($cart->goods_id)['price']}}</span></td>
                                                           <td class="text-right">
                                                               <a href="{{route('cart.cart.list')}}" class="fa fa-edit"></a>
                                                           </td>
                                                           <td onclick="removeCart(this,{{$cart->id}})" class="text-right">
                                                               <a href="javascript:;"  class="fa fa-times fa-delete"></a>
                                                           </td>
                                                       </tr>
                                                   @endforeach
                                                   @else
                                                   <tr>
                                                       请先: <a href="{{route('home.login.loginFrom')}}"> <h3>登录</h3></a>
                                                   </tr>
                                                   @endauth

                                                </tbody>
                                            </table>
                                            <script>
                                              //删除购物车里的商品,点击事件,异步请求
                                                function removeCart(obj,id) {
                                                    $.ajax({
                                                        url: '/cart/cart/removeCart/' + id,
                                                        method: 'get',
                                                        dataType: 'json',
                                                        success: function (res) {
                                                            if (res) {
                                                                $(obj).parents('tr').remove();
                                                            }
                                                        }
                                                    });

                                                }
                                            </script>
                                            <p class="text-right"> <a class="btn view-cart" href="{{route('cart.cart.list')}}"><i class="fa fa-shopping-cart"></i>查看购物车</a>&nbsp;&nbsp;&nbsp; <a class="btn btn-mega checkout-cart" href="checkout.html"><i class="fa fa-share"></i>结算</a>
                                            </p>
                                        </li>

                                 @else
                                    <li>
                                       <h2 style="width: 120px;height: 80px;margin: 0px auto; line-height: 80px"><a style="color: orangered;font-size: 26px;" href="{{route('home.login.loginFrom')}}">登录</a>后查看</h2>
                                    </li>
                                @endauth
                            </ul>
                        </div>

                    </div>
                    <!--//cart-->

                    <ul class="wishlist-comp hidden-md hidden-sm hidden-xs">
                        <li class="wishlist hidden-xs"><a href="{{route('collect.collect.list')}}" id="wishlist-total" class="top-link-wishlist" title="收藏夹"><i class="fa fa-heart"></i></a>
                        </li>
                    </ul>



                </div>

            </div>

        </div>
    </div>
    <!-- //Header center -->

    <!-- Header Bottom -->
    <div class="header-bottom hidden-compact">
        <div class="container">
            <div class="row">

                <div class="bottom1 menu-vertical col-lg-2 col-md-3 col-sm-3">
                    <div class="responsive so-megamenu megamenu-style-dev ">
                        <div class="so-vertical-menu ">
                            <nav class="navbar-default">

                                <div class="container-megamenu vertical">
                                    <div id="menuHeading">
                                        <div class="megamenuToogle-wrapper">
                                            <div class="megamenuToogle-pattern">
                                                <div class="container">
                                                    <div>
                                                        <span></span>
                                                        <span></span>
                                                        <span></span>
                                                    </div>
                                                    主题市场
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="navbar-header">
                                        <button type="button" id="show-verticalmenu" data-toggle="collapse" class="navbar-toggle">
                                            <i class="fa fa-bars"></i>
                                            <span>  主题市场 </span>
                                        </button>
                                    </div>
                                    <div class="vertical-wrapper" >
                                        <span id="remove-verticalmenu" class="fa fa-times"></span>
                                        <div class="megamenu-pattern">
                                            <div class="container-mega">
                                                <ul class="megamenu">
                                                    @foreach($classifys as $classify)
                                                    <li class="item-vertical  with-sub-menu hover">
                                                        <p class="close-menu"></p>
                                                        <a href="{{route('list',$classify)}}" class="clearfix">
                                                            <strong><img width="30px;" height="30px;" src="{{$classify->icon}}" alt="icon"></strong>
                                                            <span>{{$classify->name}}</span>
                                                            <b class="fa-angle-right"></b>
                                                        </a>
                                                        <div class="sub-menu" data-subwidth="60"  >
                                                            <div class="content" >
                                                                <div class="row">
                                                                    <div class="col-sm-12">
                                                                        <div class="row">
                                                                            @foreach($classify->classifySon($classify->id) as $item)
                                                                            <div class="col-md-12 static-menu">
                                                                                <div class="menu">
                                                                                    <ul>
                                                                                        <li>
                                                                                            <a href="{{route('list',$item)}}"  class="main-menu">{{$item->name}}</a>
                                                                                            <ul class="row">
                                                                                                @foreach($item->classifySon($item->id) as $value)
                                                                                                <li class="col-md-2"><a href="{{route('list',$value)}}" >{{$value->name}}</a></li>
                                                                                                @endforeach
                                                                                            </ul>
                                                                                        </li>
                                                                                    </ul>
                                                                                </div>
                                                                            </div>
                                                                           @endforeach
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </li>
                                                    @endforeach
                                                </ul>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </nav>
                        </div>
                    </div>

                </div>

                <!-- Main menu -->
                <div class="main-menu-w col-lg-10 col-md-9">
                    <div class="responsive so-megamenu megamenu-style-dev">
                        <nav class="navbar-default">
                            <div class=" container-megamenu  horizontal open ">
                                <div class="navbar-header">
                                    <button type="button" id="show-megamenu" data-toggle="collapse" class="navbar-toggle">
                                        <span class="icon-bar"></span>
                                        <span class="icon-bar"></span>
                                        <span class="icon-bar"></span>
                                    </button>
                                </div>
                            </div>
                        </nav>
                    </div>
                </div>
                <!-- //end Main menu -->

                <div class="bottom3">
                    <div class="telephone hidden-xs hidden-sm hidden-md">
                        <ul class="blank">
                            <li><a href="#"><i class="fa fa-truck"></i>查询订单</a></li>
                            <li><a href="#"><i class="fa fa-phone-square"></i>热线: 12584212</a></li>
                        </ul>
                    </div>
                    <div class="signin-w hidden-md hidden-sm hidden-xs">
                        <ul class="signin-link blank">
                            @auth
                                <li class="log login"><i class="fa fa-lock"></i> <a class="link-lg" href="{{route('member.member.index')}}">{{auth()->user()->name}}</a>  <a href="{{route('home.login.logout')}}">退出登录</a></li>

                            @else
                                <li class="log login"><i class="fa fa-lock"></i> <a class="link-lg" href="{{route('home.login.loginFrom')}}">登陆 </a>  <a href="{{route('home.login.resignFrom')}}">注册</a></li>

                            @endauth
                        </ul>
                    </div>
                </div>

            </div>
        </div>

    </div>
</header>
